package com.msun.monitor.constant;

import com.msun.monitor.entity.*;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Alert类型
 */
@Getter
@AllArgsConstructor
public enum AlertGroupEnum {

    ECS("node_alerts", "ECS服务器类型告警"),
    JVM("jvm_alerts", "微服务类型告警"),
    PG("pg_alerts", "数据库类告警"),
    REDIS("redis_alerts", "Redis类告警");

    private final String alertGroup;

    private final String groupDesc;


    public static AlertGroupEnum match(String alertGroup) {
        for (AlertGroupEnum anEnum : AlertGroupEnum.values()) {
            if (anEnum.alertGroup.equals(alertGroup)) {
                return anEnum;
            }
        }
        return null;
    }

}
